

/************************************************************************/
/* 
*/
/************************************************************************/

#pragma once
#define  _FILE_OFFSET_BITS 64
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string>

#include <gbm.h>
#include <GLES2/gl2.h>
#include <EGL/egl.h>
#include <EGL/eglext.h>

using namespace std;

class GLWidget
{
protected:
	EGLDisplay egldpy;
	EGLConfig eglconf;
	EGLContext eglctx;
	EGLSurface egl_surface;

	GLuint create_shader( const char *source, GLenum shader_type );
	std::string module_path();

public:
	GLWidget(EGLNativeDisplayType nativeDpy, EGLNativeWindowType nativeWindow);
	virtual ~GLWidget(void);

public:
	virtual void initgl() = 0;
	virtual void draw( int width, int height ) = 0;
	virtual void keyEvent( int key, int modifier ) = 0;
};

